﻿using System.Collections;
using UnityEngine;

public class BasePoolObject : MonoBehaviour, IPoolObject
{
    public string poolName;
    public string itemName;
    public void Init(params object[] args)
    {
        poolName = args[0] as string;
        itemName = args[1] as string;
    }
    public void GetFromPool()
    {
        gameObject.SetActive(true);
    }
    public void BackToPool()
    {
        gameObject.SetActive(false);
    }
    public void OnDestroyToBack()
    {
        ObjectPoolSystem.Instance.Put(poolName, itemName, gameObject);
    }
}
